{extend name="ashippingguide/Public/base" /}
{block name="container"}
<div class="page-heade">
    <h2 class="title_color text-center">请选择需要{if condition="$type eq 0"}异动{else /}离职{/if}的导购职员</h2>
</div>
<form action="" class="form-inline" id="form1" method="post">
    <table class="table table-bordered bud_hei">
        <tr>
            <td>姓名：</td>
            <td><input type="text" class="form-control" name="a.name" value="<?php if(isset($where['a_name'])) echo $where['a_name']; ?>"></td>
            <td>手机号码：</td>
            <td><input type="text" class="form-control" name="a.phone" value="<?php if(isset($where['a_phone'])) echo $where['a_phone']; ?>"></td>
            <td>身份证号码：</td>
            <td><input type="text" class="form-control" name="a.IDNo" value="<?php if(isset($where['a_IDNo'])) echo $where['a_IDNo']; ?>"></td>
        </tr>
        <tr>
            <td>网点所属分区：</td>
            <td><input type="text" class="form-control" name="p.title" value="<?php if(isset($where['p_title'])) echo $where['p_title']; ?>"></td>
            <td>网点所属省份：</td>
            <td><input type="text" class="form-control" name="n.title" value="<?php if(isset($where['n_title'])) echo $where['n_title']; ?>"></td>
            <td>网点所属城市：</td>
            <td><input type="text" class="form-control" name="o.title" value="<?php if(isset($where['o_title'])) echo $where['o_title']; ?>"></td>
        </tr>
        <tr>
            <td>网点负责人：</td>
            <td><input type="text" class="form-control" name="b.stuff" value="<?php if(isset($where['b_stuff'])) echo $where['b_stuff']; ?>"></td>
            <td colspan="4"></td>
        </tr>
        <tr>
            <td class="text-center" colspan="6">
                <button class="btn-sm btn-info btn" type="submit">查询</button><span class="lr_5"></span><button class="btn-sm btn-info btn" type="submit" id="reset">清空查询条件</button>
            </td>
        </tr>
    </table>
<table class="table table-striped table-bordered table-hover bud_hei text-center">
    <tr class="info">
        <td>No.</td>
        <td>姓名</td>
        <td>标准网点名称</td>
        <td>联系方式</td>
        <td>身份证号码</td>
        <td>目前状态</td>
        <td>选择</td>
    </tr>
    {volist name="data" id="list"}
    <tr>
        <td>{$i}</td>
        <td><a href="javascript:alert({$list.id});" class="thisname_{$list.id}">{$list.name}</a></td>
        <td class="text-left">{$list.wd}</td>
        <td>{$list.phone}</td>
        <td>{$list.IDNo}</td>
        <td>{$list.state}</td>
        <td><a href="javascript:;" class="change" onclick="change({$list.id})">选择</a></td>
    </tr>
    {/volist}
</table>
    <h5 class="text-center" style="font-size: 13px;font-weight: 500">
        总共有{$count}条记录，第{$page}/{$maxpage}页,当前页<input id="page" name="pages" type="text"  style="width: 40px" value=""/>
        <button id="gopage" type="submit">Go</button>&nbsp;&nbsp;<button id="fistpage" type="submit" onclick="$('#form1').find('input').val('');">首页</button>&nbsp;&nbsp;
        每页显示
        <select id="pagesize" name="limts">
            <option value='10'>10条</option>
            <option value='15'>15条</option>
            <option value='20'>20条</option>

        </select>
        <script>
            $('#pagesize').val("{$limit}");
        </script>
    </h5>
</form>
<script>


    $(document).ready(function () {
        $('#reset').on('click',function () {
            $("#form1 input").each(function(){
                $(this).val('');
            });
            $("#form1 select").each(function(){
                $(this).val('');
            });
            $('#form1').submit()
            return false
        })

    })
    /*选择需要异动的导购职员*/
    function change(id){
        var $thisname =$(".thisname_"+id).text();
            swal({
                title: "",
                text: "确定选择名字为("+$thisname+")的导购职员吗？",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "确定",
                cancelButtonText: "返回"
            },function () {
                // 0=异动，1=离职
                if("{$type}" == 0){
                    location.href = '/index/ashippingguide/editguide2?id='+id;
                }else{
                    location.href = '/index/ashippingguide/quitguidep?id='+id;
                }
            })
    }

    // $('.change').click(function () {
    //     // var $thisTr = $(this).attr('href')
    //     var $thisname =$(this).parent().siblings().find(".thisname").text()
    //     alert($thisname)
    //     // swal({
    //     //     title: "",
    //     //     text: "确定选择名字为("+$thisname+")的导购职员吗？",
    //     //     type: "warning",
    //     //     showCancelButton: true,
    //     //     confirmButtonColor: "#DD6B55",
    //     //     confirmButtonText: "确定",
    //     //     cancelButtonText: "返回"
    //     // })
    // });

</script>
{/block}
